package pos.dato;

import java.sql.*;

public class JDBCEtiquetaDAO implements IEtiquetaDAO{

    public void insert(Connection conn, String etiquetaID) {
    	String titulo = null;
        String sql = "INSERT INTO Etiquetas ( etiquetaID, titulo) VALUES (?, ?) ";
        PreparedStatement stmt = null;

        try {
            stmt = conn.prepareStatement(sql);
            
                stmt.setString(1, etiquetaID);
                stmt.setString(2, titulo);
                
                stmt.executeUpdate();
            
        } catch (SQLException e) {
            System.out.println("Message: " + e.getMessage());
            System.out.println("SQLState: " + e.getSQLState());
            System.out.println("ErrorCode: " + e.getErrorCode());
        } finally {
            try {
                if (stmt != null) {
                    stmt.close();
                }
            } catch (SQLException e) {
            }
        }
    }

}
